<?php include TMPL_PATH.'public/header.phtml';?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>角色管理</em></a><span>|</span><a href='<?php echo U('role/add');?>' ><em>添加角色</em></a>    </div>
</div>
<div class="table-list pad-lr-10">
<form name="myform" action="<?php echo U('role/listorder');?>" method="post">
    <table width="100%" cellspacing="0">
        <thead>
		<tr>
		<th width="10%">排序</th>
		<th width="10%">ID</th>
		<th width="15%"  align="left" >角色名称</th>
		<th width="265"  align="left" >角色描述</th>
		<th width="5%"  align="left" >状态</th>
		<th class="text-c">管理操作</th>
		</tr>
        </thead>
<tbody>
<?php foreach ($roleList as $role):?>
<tr>
<td width="10%" align="center"><input name='listorders[<?php echo $role['id']?>]' type='text' size='3' value='<?php echo $role['listorder']?>' class="input-text-c"></td>
<td width="10%" align="center"><?php echo $role['id']?></td>
<td width="15%"  ><?php echo $role['rolename']?></td>
<td width="265" ><?php echo $role['description']?></td>
<td width="5%" id="status-<?php echo $role['id']?>">
<?php if($role['display']==1){?><font color="red">√</font>
<?php }else{?>
<font color="blue">×</font>
<?php }?>
</td>
<td  class="text-c">
<?php if($role['id']==1):?>
<font color="#cccccc">权限设置</font> |
<a href="<?php echo U('role/member_manage','roleid='.$role['id']);?>">成员管理</a> | 
<font color="#cccccc">修改</font> | <font color="#cccccc">删除</font>
<?php else:?>
<a href="javascript:setting_role(<?php echo $role['id']?>, '<?php echo $role['rolename']?>')">权限设置</a> | 
<a href="<?php echo U('role/member_manage','roleid='.$role['id']);?>">成员管理</a> | 
<a href="<?php echo U('role/edit','roleid='.$role['id']);?>">修改</a> | 
<a href="javascript:confirmurl('<?php echo U('role/delete','roleid='.$role['id']);?>', '是否删除?')">删除</a>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>

</tbody>
</table>
<div class="btn"><input type="submit" class="button" name="dosubmit" value="排序" /></div>
</form>
</div>
</body>
<script type="text/javascript">
<!--
function setting_role(id, name) {
	window.top.art.dialog({title:'设置《'+name+'》权限',id:'edit',iframe:'<?php echo U('role/role_priv');?>&roleid='+id,width:'700',height:'500'});
}
function setting_status(id,display){
	$.get('<?php echo U('role/change_status_ajax');?>&roleid='+id+'&display='+display,function(){
			if(display==0){
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',1);"><font color="red">√</font></a>');
			}else{
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',0);"><font color="blue">×</font></a>');
			}
		});
}
//-->
</script>
</html>